package com.study.dubbo.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.study.dubbo.bean.UserAddress;
import com.study.dubbo.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created on 2019/8/22.
 *
 * @author Grak
 * @since 1.0
 */
@RestController
public class HelloAddress {

    @Reference //dubbo消费者注解
    UserService userService;

    @RequestMapping("/order")
    public List<UserAddress> initOrder(long userId) {
        List<UserAddress> ddd = userService.getUserAddress(userId);
        return ddd;
    }
}
